package com.enki.cigarettes.entity;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author Glory
 * @version 1.0
 * @time 2019-01-23 15:32
 * @Description TODO
 */
@Entity
@Table(name = "user_integral_record_t", schema = "e_cigarettes_shop", catalog = "")
public class UserIntegralRecordT {
    private String id;
    private String userTId;
    private String integralRulesId;
    private int score;
    private String remarks;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private boolean removed;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_t_id")
    public String getUserTId() {
        return userTId;
    }

    public void setUserTId(String userTId) {
        this.userTId = userTId;
    }

    @Basic
    @Column(name = "integral_rules_id")
    public String getIntegralRulesId() {
        return integralRulesId;
    }

    public void setIntegralRulesId(String integralRulesId) {
        this.integralRulesId = integralRulesId;
    }

    @Basic
    @Column(name = "score")
    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Column(name = "remarks", nullable = false, length = 65535)
    public String getRemarks() {
        return this.remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Basic
    @Column(name = "create_time")
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "removed")
    public boolean getRemoved() {
        return removed;
    }

    public void setRemoved(boolean removed) {
        this.removed = removed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserIntegralRecordT that = (UserIntegralRecordT) o;
        return score == that.score &&
                removed == that.removed &&
                Objects.equals(id, that.id) &&
                Objects.equals(userTId, that.userTId) &&
                Objects.equals(integralRulesId, that.integralRulesId) &&
                Objects.equals(remarks, that.remarks) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userTId, integralRulesId, score, remarks, createTime, updateTime, removed);
    }
}
